﻿using Farming.Domain;
using Farming.Repository;
using Microsoft.AspNetCore.Mvc;
using Panda.DynamicWebApi;
using Panda.DynamicWebApi.Attributes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Net.Mime.MediaTypeNames;

using QRCoder;
using System.Drawing.Drawing2D;
using System.Drawing;

namespace Farming.Application
{
    [DynamicWebApi]
    [ApiExplorerSettings(GroupName = "v1")]
    public class TestService: IDynamicWebApi
    {
        private readonly Repository<SoftDeleteEntity> _softDeleteEntityRepository;

        public TestService(Repository<SoftDeleteEntity> softDeleteEntityRepository)
        {
            _softDeleteEntityRepository = softDeleteEntityRepository;
        }
       /// <summary>
       /// 软删除
       /// </summary>
       /// <param name="Id"></param>
       /// <returns></returns>
        public async Task<int> DelTest01(int Id)
        {
            var model=await _softDeleteEntityRepository.GetAsync(Id);

           return  await _softDeleteEntityRepository.Delted(model);
        }
        /// <summary>
        /// 显示列表
        /// </summary>
        /// <returns></returns>
        public async Task<List<SoftDeleteEntity>> GetSoftDeleteEntityListAsync()
        {
           return await _softDeleteEntityRepository.GetAllAsync();
        }
       
       

    }
}
